---
import BaseHead from '../components/BaseHead.astro';
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import SearchBox from '../components/SearchBox.astro';
import BaseLayout from "./BaseLayout.astro";
import Container from "../components/Container.astro";
import type {CollectionEntry} from "astro:content";

type Props = {
	data: CollectionEntry<"blog">[];
	title: string
	description?: string
};

const { data,title, description = "" } = Astro.props;
---

<BaseLayout>
	<BaseHead slot="head" title={title} description={description} />
	<Header />
	<Container defaultPadding={true}>
		<div class="mb-8">
			<article class="text-black dark:text-white">
				<h2 class="text-3xl font-bold leading-normal">{title}</h2>
				<div class="mt-6">
					<slot />
				</div>
			</article>
		</div>

		<slot name="comment" />
	</Container>
	<SearchBox data={data}/>
	<Footer />
</BaseLayout>
